package com.linktrip.devicemanager.server;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linktrip.devicemanager.dao.ChannelDao;
import com.linktrip.devicemanager.entity.Channel;

@Service
public class ChannelService {
	
	@Autowired
	private ChannelDao channelDao;
	
	@SuppressWarnings("rawtypes")
	public List<Channel> listChannel(Map map) {
		return channelDao.selectChannelList(map);
	}
	
	public Channel selectByPrimaryKey(Integer id) {
		return channelDao.selectByPrimaryKey(id);
	}
	
	public Channel selectByChannelNo(String channelNo) {
		return channelDao.selectByChannelNo(channelNo);
	}

	public int updateChannel(Channel record) {
		return channelDao.updateByPrimaryKeySelective(record);
	}

	public int deleteChannel(Integer id) {
		return channelDao.deleteByPrimaryKey(id);
	}

	public int addChannel(Channel record) {
		return channelDao.insertSelective(record);
	}
}
